﻿#pragma once
#include <string>
#include <functional>
#include "hzpch.h"
#include "Hazel/Events/Event.h"
namespace Hazel
{
    // 👇 前置声明 RendererContext
    class RendererContext;

    struct WindowProps
    {
        std::string Title;
        uint32_t Width;
        uint32_t Height;

        WindowProps(const std::string &title = "Hazel Engine",
                    uint32_t width = 1600,
                    uint32_t height = 900)
            : Title(title), Width(width), Height(height)
        {
        }
    };

    // Forward declare
    class Window;

    // 窗口关闭回调
    using EventCallbackFn = std::function<void(Event &)>;

    class Window
    {
    public:
        virtual ~Window() = default;

        virtual void OnUpdate() = 0;

        virtual uint32_t GetWidth() const = 0;
        virtual uint32_t GetHeight() const = 0;

        virtual void SetEventCallback(const EventCallbackFn &callback) = 0;
        virtual void SetVSync(bool enabled) = 0;
        virtual bool IsVSync() const = 0;

        virtual void *GetNativeWindow() const = 0;
        virtual RendererContext &GetContext() = 0;

        static Window *Create(const WindowProps &props = WindowProps());
    };

} // namespace Hazel